<template>
    <span> {{ index + 1 }}: {{ statusRes }}</span>
</template>

<script>
import Bus from '@/utils/EventBus';

export default {
    name: 'FlagItem',
    props: {
        status: {
            type: String,
        },
        index: {
            type: Number,
        },
    },

    data() {
        return {
            statusRes: this.status
        }
    },

    created() {
        Bus.$on('statusResult', (value) => {
            if (value.index === this.index) {
                this.statusRes = value.status;
            }
        });
        console.log(this.statusRes);
    },
};
</script>

<style scoped>
.right {
    color: green;
}

.error {
    color: red;
}

.undo {
    color: #ccc;
}
</style>